import { defineStore } from "pinia";
import { allocation, isEnabled } from "@/Api/api.js";
// 路由
export const useRouterStore = defineStore("router", {
    state: () => ({
        id: '',
        bonus: {}
    }),
    actions: {
        // 积分
        allocationLiss() {
            allocation().then(res => {
                let {
                    data: { data: bonus },
                } = res;
                this.bonus = bonus
                // console.log(bonus)
            })
        },
        // 路由
        isEnabledLiss() {
            isEnabled().then(res => {
                let {
                    data: { data },
                } = res;
                this.id = data
            })
        }
    },
});